import EventCenter from "./EventCenter";
import SceneManager from "../scene/SceneManager";
import AudioManager from "./AudioManager";
import GameLocalData from "./GameLocalData";
import GameData from "./GameData";
import { ScoreObjPool } from "./ScoreObjPool";
import PopUpManager from "./PopUpManager";
import { GameConfig } from "./GameConfig";

export default class GameManager {
    public eventCenter: EventCenter;
    public sceneManager: SceneManager;
    public audioManager: AudioManager;
    public gameLocalData:GameLocalData;
    public gameData:GameData;

    private static _instance:GameManager = null;
    public static getInstance() {
        if (!GameManager._instance) {
            GameManager._instance = new GameManager();
        }
        return GameManager._instance;
    }

    constructor() {
        cc.game.setFrameRate(60);
        PopUpManager.initTextTips("prefab/textTips");
        
        this.eventCenter = new EventCenter();
        this.audioManager = new AudioManager();
        this.gameLocalData = new GameLocalData();
        this.gameData = new GameData();

        //初始化分数对象池
        ScoreObjPool.InitPool();
    }
}